package com.mtcarpenter.mall.client.fallback;

import com.mtcarpenter.mall.client.CmsSubjectProductRelationClient;
import com.mtcarpenter.mall.common.CmsSubjectProductRelationInput;
import com.mtcarpenter.mall.common.api.CommonResult;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class CmsSubjectProductFallBack implements CmsSubjectProductRelationClient {
    @Override
    public CommonResult relateAndInsertList(List<CmsSubjectProductRelationInput> productRelationInputs, Long productId) {
        return null;
    }

    @Override
    public CommonResult relateAndUpdateList(List<CmsSubjectProductRelationInput> productRelationInputs, Long productId) {
        return null;
    }

    @Override
    public CommonResult<List<CmsSubjectProductRelationInput>> relationByProductId(Long productId) {
        String message = "服务降级处理 CmsSubjectProductFallBack relationByProductId : productId is : " + productId;
        System.out.println(message);
        return CommonResult.failed(message);
    }

    @Override
    public CommonResult cmsTestSeata(Long id) {
        return null;
    }
}
